package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.DamageList;
import com.atguigu.jxc.service.DamageListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @author 里
 * @Description:
 */
@RestController
@RequestMapping("/damageListGoods")
public class DamageListGoodsController {

    @Autowired
    private DamageListGoodsService damageListGoodsService;

    /**
     * 报损单查询
     * @param sTime
     * @param eTime
     * @return
     */
    @RequestMapping("list")
    public Map<String,Object> getDamageListGoodsList(String  sTime, String  eTime){
        return damageListGoodsService.getDamageListGoodsList(sTime,eTime);
    }

    /**
     * 保存报损单
     * @param damageList
     * @param damageListGoodsStr
     * @return
     */
    @RequestMapping("save")
    public ServiceVO saveDamageList(DamageList damageList, String damageListGoodsStr, HttpSession session){
        return damageListGoodsService.saveDamageList(damageList,damageListGoodsStr,session);
    }


    /**
     *
     * @param damageListId
     * @return
     */
    @RequestMapping("goodsList")
    public Map<String,Object> goodsListById(Integer damageListId){
        return damageListGoodsService.goodsListById(damageListId);
    }

}
